package main

import (
	"github.com/gin-gonic/gin"
	"go-demo/common"
	"go-demo/dao"
	"go-demo/router"
)

// @title Swagger Example API
// @version 1.0
// @description This is a sample server celler server.
// @termsOfService http://swagger.io/terms/
// @license.name Apache 2.0
func main() {
	//执行数据初始化
	dao.Init()
	//dao.CreateTable()
	go router.RunMessageServer()

	r := gin.Default()

	//注册跨域配置中间件
	r.Use(common.Cors())

	router.InitRouter(r)

	r.Run() // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
}
